package com.lb.activity.util;

import com.lb.activity.po.SessionUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;

/**
 * session工具类
 * @author 001030
 */
public class SessionUtil {

    /**
     * 后去后台的登录用户
     * @return
     */
    public static SessionUser getSessionUser(){
        Session session = SecurityUtils.getSubject().getSession();
        SessionUser sessionUser = (SessionUser)session.getAttribute("sessionUser");
        if(sessionUser != null){
            return sessionUser;
        }
        return null;
    }

}
